{extend name="base"}
{block name="body"}
<ol class="breadcrumb">
  <li><a href="#">首页</a></li>
  <li><a href="{:url('admin/index')}">管理员管理</a></li>
  <li class="active">管理员信息修改</li>
</ol>
<form class="form-horizontal" action="{:url('update_admin','id='.$userInfoItem.id)}" method="post" enctype="multipart/form-data">
  <div class="form-group">
    <label for="name" class="col-sm-1 control-label">用户名</label>
    <div class="col-sm-2">
      <input type="text" class="form-control" id="username" name="username" placeholder="管理员用户名" value="{$userInfoItem.username}">
    </div>
  </div>
  <div class="form-group">
    <label for="password" class="col-sm-1 control-label">登录密码</label>
    <div class="col-sm-2">
      <input type="password" class="form-control" name="password" placeholder="管理员登录密码" value="{$userInfoItem.password}">
    </div>
  </div>
  <div class="form-group">
    <label for="category" class="col-sm-1 control-label">所属角色</label>
    <div class="col-xs-2">        
        <select class="form-control" id="level" name="level">
          <option value="1">超级管理员</option>
          <option value="2">网站编辑员</option>
          <option value="3">客服小秘书</option>
          <option value="4">仓库管理员</option>          
        </select>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-1 col-sm-11">
      <button type="submit" class="btn btn-default">提交</button>
    </div>
  </div>
</form>
<script>
$(document).ready(function() {
  $('option').each(function(i) {
    if(this.innerHTML=='{$userInfoItem.level}'){
      this.selected=true;
    }
  });
  
});
</script>
{/block}